<template>
   <view class="container">
       <view class="head">
           <view>{{details?.title}}</view>
           <view class="time">
               <view>发布人：{{details?.updateUser}}</view>
               <view>时间：{{details.createTime}}</view>
           </view>
       </view>
       <view class="content">
		   
		   <view class="noticeAbstract" v-if="details?.noticeAbstract">
			   <view style="font-weight: 500;font-size: 28rpx;margin-bottom: 10rpx;">摘要:</view>
			   {{details?.noticeAbstract}}
		   </view>
           <rich-text :nodes="conetnt"></rich-text>
       </view>
   </view>
</template>
<script setup>

import {
	dailyNoticeDetail,
	readeDldailyNotice
} from "@/api" 
import {
	onLoad,
	onReachBottom
} from '@dcloudio/uni-app';

const conetnt=ref('')
const productDetails=ref('')
const  dealContent=(htmlContent)=> {
  const regex = new RegExp('<img', 'gi')
  let htmlContents = htmlContent.replace(regex, `<img style="max-width: 100%;"`)
  productDetails.value = htmlContents
}
const details=ref('')
const noticeId=ref('')
onLoad((options)=>{
	noticeId.value=options.id
	getDeatil()
})

const getDeatil=()=>{
	dailyNoticeDetail({
		id:noticeId.value
	}).then(res=>{
		details.value=res.data
		conetnt.value=res.data.content 
		details.value=res.data
	}).then(res=>{
		readeDldailyNotice({
			id:noticeId.value
		})
	})
}
</script>
<style lang="scss" scoped>
 
.container{
    padding: 0 30rpx;
    background: #fff;
}
.head{
    text-align: center;
    font-size: 32rpx;
    font-weight: 600;
    padding: 40rpx 20rpx;
    border-bottom: 1px solid #e1e1e1;
    .time{
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #999;
        font-size: 24rpx;
        padding-top: 20rpx;
    }
}
.content{
    padding-top: 20rpx;
}
.noticeAbstract{
	font-size: 26rpx;
	padding: 10rpx 0;
	color: #666;
}
</style>